<?php

namespace app\model;

use think\Model;

class StationType extends Model
{
    public function saveData(): array
    {
        $param = request()->post();
        $this->exists(!empty($param['id']))->save($param);
        return $this->toArray();
    }

    public function lst(): array
    {
        $param = request()->param();
        $data = $this->order('create_time','desc')->paginate(['list_rows'=>30,'page'=>$param['page'] ?? 1])->toArray();
        return pageData($data);
    }
}
